<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>盒子塌陷问题解决方案1</title>
		<style>
			#main {
				border: 1px solid red;
			}

			#main>div {
				height: 160px;
				width: 160px;
				background-color: black;
				color: white;
				float: left;
				margin: 4px;
			}

			.clear::after {
				content: '';
				display: block;
				clear: both;
			}
		</style>
	</head>
	<body>
		<p>
			方法4，浮动元素外层盒子添加:after伪类样式，在样式设置清除。
		</p>
		<div id="main" class="clear">
			<div>1</div>
			<div>222</div>
			<div>3</div>
			<div>4</div>
			<div>5</div>
			<div>6</div>
			<div>7</div>
			<div>8</div>
			<div>9</div>
			<div>
				<select name="province">
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>
					<option value="anhui">安徽</option>

					<option value="anhui">安徽</option>
				</select>
			</div>
		</div>

		<p style="border: 5px groove goldenrod;">
			王帅是个好小伙
		</p>
	</body>
</html>
